<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MQTT连接配置</title>
    <link rel="stylesheet" href="./css/style.css">
</head>
<body>
    <div class="container">
        <h1>MQTT连接配置</h1>
        <form id="mqtt-config">
            <div class="form-group">
                <label for="client-id">Client ID</label>
                <input type="text" id="client-id" required>
            </div>
            <div class="form-group">
                <label for="url">MQTT服务器地址</label>
                <input type="text" id="url" placeholder="ws://mqtt.example.com:8083/mqtt" required>
            </div>
            <div class="form-group">
                <label for="port">端口号</label>
                <input type="number" id="port" value="8083" required>
            </div>
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username">
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password">
            </div>
            <div class="form-group">
                <label for="keepalive">心跳间隔(秒)</label>
                <input type="number" id="keepalive" value="60">
            </div>
            <div class="form-group">
                <label for="subscribe-topic">订阅主题</label>
                <input type="text" id="subscribe-topic" placeholder="topic/to/subscribe">
            </div>
            <div class="form-group">
                <label for="publish-topic">发布主题</label>
                <input type="text" id="publish-topic" placeholder="topic/to/publish">
            </div>
            <button type="submit">保存配置</button>
        </form>
    </div>
    <script src="./js/mqtt.js"></script>
    <script src="./js/config.js"></script>
</body>
</html>